<template>
  <div>
    <SearchContainer @search="getData" @reset="() => formRef.resetFields()">
      <a-form ref="formRef" class="form-style-flex" :model="formState" :label-col="{ style: { width: '80px' } }">
        <a-form-item name="zjm" label="">
          <a-input v-model:value="formState.zjm" class="w-64" placeholder="编号/就诊事项/缩写/助记码" @keydown.enter="getData" />
        </a-form-item>
      </a-form>
    </SearchContainer>
    <a-card class="mt-2">
      <BaseTable fill :data-source="tableData" :loading="loading" :scroll="{ x: 1800 }" column-code="000048" :pagination="pagination">
        <template #bodyCell="{ column, index }">
          <template v-if="column.dataIndex === 'no'">
            {{ index + 1 }}
          </template>
        </template>
      </BaseTable>
    </a-card>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const formRef = ref(null)
const formState = ref({
  zjm: ''
})
const { loading, tableData, pagination, getData } = useTable({
  url: '/operation/opex/getDictOutpMatterList',
  immediate: true,
  params: formState.value
})
</script>
